package com.gmrz.uaf.server;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class TestServlet extends HttpServlet {

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }


    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setHeader("Content-type", "application/fido.trusted-apps+json;text/html; charset=UTF-8");
        response.setHeader("Accept","application/fido.trusted-apps+json;text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
        request.setCharacterEncoding("UTF-8");   //设置编码
        response.addDateHeader("Last-Modified", System.currentTimeMillis());
        response.setDateHeader("Expires",-1);
        response.setHeader("Cache-Control", "no-cache");
        response.setHeader("Pragma", "no-cache");
        response.getOutputStream().write("ok".getBytes());
    }
}
